﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Threading.Tasks;
using System.ComponentModel.DataAnnotations;

namespace OnlineEducation.Data.Entities
{
    public class Holiday : EntityBase
    {
        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int Id { get; set; }

        [Display(Name = "年份")]
        [Required(ErrorMessage = "年份不能为空")]
        [StringLength(100, ErrorMessage = "长度不能超过100")]

        public string Year { get; set; }

        [Display(Name = "假期")]
        [Required(ErrorMessage = "假期不能为空")]
        [StringLength(100, ErrorMessage = "长度不能超过100")]
        public string Name { get; set; }
        [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:yyyy-MM-dd}")]
        public DateTime FromDate { get; set; }
        [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:yyyy-MM-dd}")]
        public DateTime ToDate { get; set; }

        public int Status { get; set; }
 
        [Required(ErrorMessage ="日期不能为空")]
        public string Range { get; set; }


    }
}
